<template>
	<view class="box" @click="onclick" :style="{background: color}">
		{{num}}
	</view>
	<switch @change="switchChage"></switch>
	<button type="primary" :loading="isLoading">普通按钮</button>
</template>

<script setup>
	import {ref} from 'vue'
	const num = ref(1)
	const color = ref('#fc359a')
	let isLoading = ref(false)
	function onclick(){
		num.value ++
		color.value = '#' + Math.floor(Math.random() * 0xffffff).toString(16).padStart(6, '0')
	}
	
	function switchChage(e){
		isLoading.value = e.detail.value
	}
</script>

<style lang="scss">
	.box{
		width: 200px;
		height: 200px;
		background: orange;
	}
</style>
